<template>
	<view class="page_sched">
		<!-- 信息 -->
		<view class="video-info" v-if="dataForm.pk_id">
			<view class="video-title">{{ dataForm.name }}</view>
			<view class="video-desc">
				<view>{{ dataForm.date_creation | formTime }}</view>
				<view v-if="dataForm.view > 0">浏览数量：{{ dataForm.view }}</view>
			</view>
		</view>
		<sww-swipe :list="swipeList" :indicatorDots="true"></sww-swipe>
		<view class="parser-box"><u-parse :html="dataForm.details"></u-parse></view>
	</view>
</template>

<script>
import { formatDate } from '@/utils/moment/index.js';
export default {
	components: {},
	data() {
		return {
			guestId: null,
			dataForm: {
				details: ''
			},
			swipeList: []
		};
	},
	filters: {
		formTime(time) {
			return formatDate(time, 'YYYY-MM-DD HH:mm:ss');
		}
	},
	onLoad(options) {
		if (options && options.id) {
			this.guestId = Number(options.id);
			this.getDetail();
		}
	},

	methods: {
		getDetail() {
			this.$loading();
			this.$resPost('GetMeetingHonouredGuestInfo', {
				pk_id: this.guestId
			})
				.then(({ data }) => {
					this.dataForm = data;

					let swipeList = [];
					if (data.voide) {
						swipeList.push({
							video: data.voide
						});
					}
					if (data.img) {
						data.img.split(',').forEach(item => {
							swipeList.push({
								img: item
							});
						});
					}
					this.swipeList = [].concat(swipeList);
					this.$hide();
				})
				.catch(() => {
					this.$hide();
				});
		}
	}
};
</script>
<style>
page {
	background-color: #fff;
}
</style>
<style scoped lang="scss">
.video-info {
	width: 100%;
	padding: 0 24rpx;

	.video-title {
		text-align: center;
		font-size: 36rpx;
		font-weight: bold;
		padding: 10rpx 0;
	}

	.video-desc {
		font-size: 28rpx;
		color: #999999;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 30rpx 0 20rpx;
	}
}
.parser-box {
	margin-top: 20rpx;
	width: 100%;
	padding: 0 30rpx;

	video {
		width: 100% !important;
	}
}
</style>
